package com.jpa.repository;

import com.jpa.pojo.Student;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * Created by fangjicai on 2020/6/7.
 */
public interface StudentRepository extends JpaRepository<Student,Long> {
    //查询数据中指定名字的学生
    List<Student> findByName(String name);
    //根据名字模糊搜索
    List<Student> findByNameLike(String name);
    //根据名字和年龄查询
    List<Student> getByNameAndAge(String name,String age);
    //根据年龄范围查询
    List<Student> getByAgeBetween(Integer starter,Integer end);
    //删除指定名字学生
    Long deleteByName(String name);
    //统计执行名字学生的数量
    Long countByName(String name);
    //分业模糊查询
    List<Student> findByNameLike(String name, Pageable page);
}
